<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
        body {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            background-color: #f8f9fa;
        }
        .form-container {
            width: 100%;
            max-width: 400px;
            padding: 15px;
            margin: auto;
            background-color: #fff;
            border: 1px solid #dee2e6;
            border-radius: 5px;
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }
        .form-container .btn-group {
            width: 100%;
        }
        .form-container .btn-group button,
        .form-container .btn-group a {
            width: 49%;
        }
        .form-container .btn-group a {
            margin-left: 2%;
        }
    </style>
    <title>动物园管理系统--注册</title>
</head>
<body>
<div class="form-container">
    <div class="text-center mb-4">
        <h1 class="h3 mb-3 font-weight-normal">动物园管理系统</h1>
    </div>
    <form action="register" method="post">
        <div class="form-group">
            <label for="inputUsername">用户名</label>
            <input type="text" class="form-control" id="inputUsername" name="username" placeholder="用户名" required autofocus>
        </div>
        <div class="form-group">
            <label for="inputPassword">密码</label>
            <input type="password" class="form-control" id="inputPassword" name="password" placeholder="密码" required>
        </div>
        <div class="form-group">
            <label for="inputPhone">手机号</label>
            <input type="text" class="form-control" id="inputPhone" name="phone" placeholder="手机号" required>
        </div>
        <div class="form-group">
            <label for="inputGender">性别</label>
            <select class="form-control" id="inputGender" name="gender">
                <option value="1">男</option>
                <option value="2">女</option>
            </select>
        </div>
        <div class="form-group">
            <label for="selectRole">用户类型</label>
            <select class="form-control" id="selectRole" name="userType">
                <option value="1">用户</option>
                <option value="2">员工</option>
                <option value="3">管理员</option>
            </select>
        </div>
        <div class="text-danger mb-3">${errorMessage}</div> <!-- 显示错误信息 -->
        <div class="btn-group">
            <button type="submit" class="btn btn-primary">注册</button>
            <a href="login.jsp" class="btn btn-secondary">登录</a>
        </div>
    </form>
</div>
</body>
</html>
